/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.example.touch.communication.entities;

import java.util.ArrayList;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.ElementListUnion;

/**
 *
 * @author krist_000
 */
public class Event {

    @Attribute
    private String id;
    
    @Attribute(required = false)
    private String action;
    
    @Attribute(required = false)
    private String message;
    
    @Attribute(required = false)
    private String browserUrl;
    
    @Attribute(required = false)
    private String duration;
    @Attribute(required = false)
    private String mediaSource;
    @Attribute(required = false)
    private String soundSource;
    
    @Element(name="triggerConditions", type = TriggerConditionList.class)
    private TriggerConditionList triggers;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getMessage() {
        return message;
    }
    
    public String getBrowserUrl()
    {
    	return browserUrl;
    }

    public void setBrowserUrl(String browserUrl)
    {
    	this.browserUrl = browserUrl;
    }
    
    public void setMessage(String message) {
        this.message = message;
    }

    public String getDuration() {
        return duration;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    public String getMediaSource() {
        return mediaSource;
    }

    public void setMediaSource(String mediaSource) {
        this.mediaSource = mediaSource;
    }

    public String getSoundSource() {
        return soundSource;
    }

    public void setSoundSource(String soundSource) {
        this.soundSource = soundSource;
    }   

    public TriggerConditionList getTriggers() {
		return triggers;
	}

	public void setTriggers(TriggerConditionList triggers) {
		this.triggers = triggers;
	}

	@Override
    public String toString() {
        String str = "";
        str += "Event: " + getId();
        if (action != null) {
            str += " action " + action;
        }
        if (message != null) {
            str += " message " + message;
        }
        if (duration != null) {
            str += " duration " + duration;
        }
        if (mediaSource != null) {
            str += " mediaSource " + mediaSource;
        }
        if (soundSource != null) {
            str += " soundSource " + soundSource;
        }
        str += "\n";
        return str;
    }

}
